<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

Route::group(['middleware' => ['web']], function () {
	Route::get('/login/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/login/','API\User@login');

	Route::get('/auth/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/auth/','API\User@auth');

	Route::get('/pushthedata/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/pushthedata/','API\Dialog@addTheCache');

	Route::get('/getthedata/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/getthedata/','API\GetTheData@getTheData');

	Route::get('/getthepost/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/getthepost/','API\ThePost@getThePost');

	Route::get('/addthepost/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/addthepost/','API\ThePost@addPost');

	Route::get('/appendthepost/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/appendthepost/','API\ThePost@appendThePost');

	Route::get('/upload/',function(){
		return 'The API can not be used by the GET method';
	});
	Route::post('/upload/','API\FileController@upload');
	
});
